package org.qpcr.community.project.web;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.hswebframework.ezorm.core.param.Term;
import org.hswebframework.reactor.excel.ReactorExcel;
import org.hswebframework.web.api.crud.entity.QueryParamEntity;
import org.hswebframework.web.authorization.annotation.Authorize;
import org.hswebframework.web.authorization.annotation.QueryAction;
import org.hswebframework.web.authorization.annotation.Resource;
import org.hswebframework.web.crud.web.reactive.ReactiveServiceCrudController;
import org.qpcr.community.project.model.entity.TestSequenceInstanceEntity;
import org.qpcr.community.project.model.entity.VersionUpdateRecordsEntity;
import org.qpcr.community.project.service.VersionUpdateRecordsService;
import org.qpcr.community.project.web.excel.TestSequenceExcelInfo;
import org.springframework.http.HttpHeaders;
import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 软件版本更新记录
 */
@RestController
@RequestMapping( {"/version/records"})
@Authorize
@Resource(id = "version-records", name = "软件版本更新记录管理（废弃）")
@Slf4j
@Tag(name = "软件版本更新记录管理")
@RequiredArgsConstructor
public class VersionUpdateRecordsController implements ReactiveServiceCrudController<VersionUpdateRecordsEntity, String> {
    @Getter
    private final VersionUpdateRecordsService service;


    @GetMapping("/dateTime")
    @Authorize(ignore = true)
    @Operation(summary = "设备端同步时间")
    public Mono<Long> downloadExportTemplate() throws IOException {

//        Date date = new Date();
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Long formattedDate = new Date().getTime();

        return Mono.just(formattedDate);
    }

}
